<!DOCTYPE html>
<!-- <html> -->
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>欢迎进入“筠”的flask推特模拟项目</title>
  <meta http-equiv="Content-Type" content="text/html; Charset=utf-8" />
  <meta http-equiv="Content-Language" content="zh-CN" />
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
  <title>筠博客网-关于本站</title>
  <link rel="shortcut icon" href="images/logo.png" type="image/x-icon" />
  <link href="{{url_for('static',filename='layui/css/layui.css')}}" rel="stylesheet">
  <script src="{{url_for('static',filename='layui/layui.js')}}"></script>
  <script type="text/javascript" src="{{url_for('static',filename='js/jquery-3.2.1.js')}}"></script>
  <script type="text/javascript" src="{{url_for('static',filename='js/jquery.min.js')}}"></script>
  <!--font-awesome-->
  <link href="{{url_for('static',filename='font-awesome/css/font-awesome.min.css')}}" rel="stylesheet" />
  <!--全局样式表-->
  <link href="{{url_for('static',filename='css/global.css')}}" rel="stylesheet" />
  <link href="{{url_for('static',filename='css/animate.min.css')}}" rel="stylesheet" />
  
</head>
<body>
  <!-- 导航 -->
  <nav id="h" class="blog-nav layui-header">
    <div class="blog-container">
      <button style="line-height: 0px;top: 15px;color:bisque;" class="blog-user layui-btn layui-btn-primary demo-dropdown-base" >
        <span >个人中心</span>
        <i class="layui-icon layui-icon-down layui-font-12"></i>
      </button>
      <a class="blog-logo" href="{{url_for('index')}}">筠博客网</a>

      <a style="position: absolute;right: 130px;top: 17px;z-index: 12;" href="{{url_for('article_editor')}}?check_look_or_edit=True" title="写文章">
        <i  class="layui-icon layui-icon-add-circle-fine" style="font-size: 35px; color: white;"></i>
      </a>


      <ul class="layui-nav" lay-filter="nav" style="text-align: end !important;">
        <li class="layui-nav-item {% if parsed_url_path == url_for('index') %} layui-this {% endif %}" style="right: 15px">
          <a href="{{url_for('index')}}"><i class="fa fa-home fa-fw"></i>&nbsp;home</a>
        </li>
         <!-- <li class="layui-nav-item">
          <a href="article.html"><i class="fa fa-file-text fa-fw"></i>&nbsp;写博客</a>
        </li> -->
        <!--<li class="layui-nav-item">
          <a href="mixed_pic.html"><i class="fa fa-paper-plane-o fa-fw"></i>&nbsp;杂七杂八</a>
        </li>
        <li class="layui-nav-item">
          <a href="timeline.html"><i class="fa fa-hourglass-half fa-fw"></i>&nbsp;点点滴滴</a>
        </li> -->
        <!-- <li class="layui-nav-item {% if parsed_url_path == url_for('index') %} layui-this {% endif %}">
          <a href="about.html"><i class="fa fa-info fa-fw"></i>&nbsp;关于本站</a>
        </li> -->
        <span class="layui-nav-bar"></span>
      </ul>

      <a class="blog-navicon" href="javascript:;">
        <i class="fa fa-navicon"></i>
      </a>
    </div>
  </nav>

  <div class="blog-body">
    {% block content %}
    {% endblock %}
  </div>
    
    <script>
      layui.use(function(){
          var dropdown = layui.dropdown;
          var check_login_status = null;
          var url_data = null
          // 渲染
          // console.log('{{current_user.is_anonymous}}')

          if ('{{current_user.is_anonymous}}' == "True"){
            check_login_status = "登录"
            url_data = "{{url_for('login')}}"
          }else{
            check_login_status = "退出登录"
            url_data = "{{url_for('logout')}}"
          }
          
          dropdown.render({
            elem: '.demo-dropdown-base', // 绑定元素选择器，此处指向 class 可同时绑定多个元素
            data: [{
              title: '修改信息 ',
              id: 100
            },{
              title: check_login_status,
              id: 101
            }],
            click: function(data){
                switch (data.id) {
                    case 100:
                        window.location.href = "{{url_for('edit_profile')}}"
                        break;
                    case 101:
                        location.href = url_data;
                        break;
                    default:
                       
                }

            }
        });
      })
    </script>
</body>
